<template>
	<view class="home-container page-wrapper">
		<view class="logo-container">
			<image :src="$getImageUrl('login-logo@2x.png')" class="logo"> </image>
			<image :src="$getImageUrl('login-title@2x.png')" class="title" />
		</view>
		<view>
			<u-button type="primary" open-type="getPhoneNumber" shape="circle" @getphonenumber="getUserPhoneNumber">
				微信授权并登录
			</u-button>
		</view>
	</view>
</template>

<script>
	export default {
		name: "Login",
		onLaunch(opt){
			console.log(opt,'onLaunch222');
		},
		onLoad(opt){
			console.log(opt,'onLoad');
		},
		onShow(){
			const options = getCurrentPages()[getCurrentPages().length - 1].options
			console.log(options,'onShow');
		},
		data() {
			return {
				code: "",
			};
		},
		methods: {
			getUserPhoneNumber(e) {
				console.log(e);
				this.code = e.detail.code;
				uni.login()
			},
		},
	};
</script>

<style lang="scss">
	.home-container {
		height: 100vh;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		padding: 48rpx 40rpx;

		.logo-container {
			text-align: center;

			.logo {
				margin: 228rpx 0 100rpx;
				width: 448rpx;
				height: 356rpx;
			}

			.title {
				width: 480rpx;
				height: 84rpx;
			}
		}
	}
</style>
